# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kid3
pkgver=3.9.6
pkgrel=0
pkgdesc="Efficient audio tagger that supports a large variety of file formats"
url="https://kid3.kde.org/"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="GPL-2.0-or-later"
makedepends="
	chromaprint-dev
	extra-cmake-modules
	ffmpeg-dev
	flac-dev
	id3lib-dev
	libvorbis-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtmultimedia-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	readline-dev
	samurai
	taglib-dev
	zlib-dev
	"
subpackages="$pkgname-doc"
_repo_url="https://invent.kde.org/multimedia/kid3.git"
source="https://download.kde.org/stable/kid3/$pkgver/kid3-$pkgver.tar.xz"

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DWITH_APPS="qt;qml;cli"
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1667b3f5d458f9cc54e5b9af839c849e990a333eab3cfaa8d310b4d46b925ca5b57ea0ac9365a023fecc1ac2429f761dd2bfc0b3a3df48f5d4dd351c8741455f  kid3-3.9.6.tar.xz
"
